Just: Safe Unknown Types in Java-like Languages

نویسندگان

  • Giovanni Lagorio
  • Elena Zucca
چکیده

Most mainstream object-oriented languages, like C++, Java and C#, are statically typed. In recent years, untyped languages, in particular scripting languages for the web, have gained a lot of popularity notwithstanding the fact that the advantages of static typing, such as earlier detection of errors, are widely accepted. We think that one of the main reasons for their widespread adoption is that, in many situations, the ability of ignoring types can be handy to write simpler and more readable code. We propose an extension of Java-like languages which allows developers to forget about typing in strategic places of their programs without losing type-safety. That is, we allow programmers to write simpler code without sacrificing the advantages of static typing. This is achieved by means of inferred type constraints. These constraints describe the implicit requirements on untyped code to be correctly invoked. This flexibility comes at a cost: field accesses and method invocations on objects of unknown types are less efficient than regular field accesses and method invocations. Also, our type system is currently more restrictive than it should be; its extension is the subject of ongoing work. We have implemented our approach on a small, yet significant, Java subset.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Safe Implementation of Dynamic Overloading in Java-Like Languages

We present a general technique for extending Java-like languages with dynamic overloading, where method selection depends on the dynamic type of the parameter, instead of just the receiver. To this aim we use a core Java-language enriched with encapsulated multi-methods and dynamic overloading. Then we define an algorithm which translates programs to standard Java code using only basic mechanis...

متن کامل

Code Importing Techniques for Fast , Safe Client / Server Access by Joseph A . Bank

In client/server systems, server integrity can be maintained by disallowing direct client access to server data and requiring communication through well-defined interfaces. Typically, this communication requires expensive cross-domain calls, or even more expensive network communication. The main goal of this thesis is to create a system with fast, safe client/server access by allowing the serve...

متن کامل

Type inference for polymorphic methods in Java-like languages

In mainstream class-based object-oriented languages with nominal types, like C++, Java and C#, typechecking algorithms require methods to be annotated with their parameter types, which are either fixed or constrained by a (nominal) bound. On the contrary, languages like ML, CaML and Haskell use powerful type inference algorithms capable of calculating the type for a function in which parameter ...

متن کامل

A Verifiable SSA Program Representation for Aggressive Compiler Optimization Extended

We present a verifiable low-level program representation to embed, propagate, and preserve safety information in high performance compilers for safe languages such as Java and C#. Our representation precisely encodes safety information via static single-assignment (SSA) [11, 3] proof variables that are first-class constructs in the program. We argue that our representation allows a compiler to ...

متن کامل

Type-Safe Optimisation of Plugin Architectures

Programmers increasingly implement plugin architectures in type-safe object-oriented languages such as Java. A virtual machine can dynamically load class files containing plugins, and a JIT compiler can do optimisations such as method inlining. Until now, the best known approach to type-safe method inlining in the presence of dynamic class loading is based on Class Hierarchy Analysis. Flow anal...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Journal of Object Technology

دوره 6  شماره 

صفحات  -

تاریخ انتشار 2007